<div class="content-wrapper">
    <section class="content-header">
        <?php echo $this->partial('layout/breadcrumb'); ?>
        <h1 class="pull-right" id="dbshop-menu-top">
            <a href="<?php echo $this->url('operation-recharge-code');?>" class="btn btn-default btn-sm"><i class="fa fa-arrow-left"></i> <?php echo $this->translate('返回充值码规则列表'); ?></a>
            <?php echo $this->HelpUrl('rechargeCode'); ?>
        </h1>
    </section>

    <section class="content">
        <div class="row">
            <div class="col-md-12">
                <div class="box">
                    <div class="box-body">
                        <h2 class="page-header">
                            <?php echo $this->rechargeRuleInfo->getCodeRuleTitle() . ' ' . $this->translate('充值码列表'); ?>
                        </h2>
                        <div class="text-right">
                            <form method="post" name="export-form" action="<?php echo $this->url('operation-recharge-code', ['action' => 'exportRechargeCode', 'id' => $this->rechargeRuleInfo->getCodeRuleId()]); ?>">
                                <select name="codeState" id="codeState" class="form-control input-sm" style="width: 120px;display: inline">
                                    <option value="1"><?php echo $this->translate('全部'); ?></option>
                                    <option value="2"><?php echo $this->translate('未充值'); ?></option>
                                    <option value="3"><?php echo $this->translate('已充值'); ?></option>
                                </select>
                                <button type="submit" class="btn btn-primary btn-sm"><i class="fa fa-share" aria-hidden="true"></i> <?php echo $this->translate('导出充值码'); ?></button>
                            </form>
                        </div>
                    </div>
                    <?php echo $this->partial('layout/messages'); ?>
                    <div class="box-body table-responsive no-padding">
                        <table class="table shop-table table-hover">
                            <thead>
                            <tr class="shop-bg-thead">
                                <th width="40%"><?php echo $this->translate('充值码'); ?></th>
                                <th width="10%"><?php echo $this->translate('充值金额'); ?></th>
                                <th width="10%"><?php echo $this->translate('状态'); ?></th>
                                <th width="10%"><?php echo $this->translate('充值人'); ?></th>
                                <th width="15%"><?php echo $this->translate('充值时间'); ?></th>
                                <th width="15%"><?php echo $this->translate('创建时间'); ?></th>
                            </tr>
                            </thead>
                            <tbody>
                            <?php
                            if ($this->rechargeCodeList) foreach ($this->rechargeCodeList as $codeValue) { ?>
                                <tr>
                                    <td><?php echo $this->escapeHtml($codeValue->getCodeStr()); ?></td>
                                    <td><?php echo $this->escapeHtml($codeValue->getCodeMoney()); ?></td>
                                    <td><?php echo $codeValue->getUserId() > 0 ? '<span class="text-green">'.$this->translate('已充值').'</span>' : $this->translate('未充值'); ?></td>
                                    <td><?php echo $this->escapeHtml($codeValue->getUserName()); ?></td>
                                    <td><?php echo $codeValue->getCodeRechargeTime() > 0 ? $this->shopDateFormat()->rechargeCodeTime($codeValue->getCodeRechargeTime()) : ''; ?></td>
                                    <td><?php echo $this->shopDateFormat()->rechargeCodeTime($codeValue->getCodeCreateTime()); ?></td>
                                </tr>
                            <?php } ?>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>

    </section>
</div>